
from flask import Blueprint, send_from_directory
from services.documentation_service import get_documentation_path

documentation = Blueprint('documentation', __name__)

@documentation.route('/<filename>')
def show_documentation_img(filename):
    print(filename)
    avatar_folder = get_documentation_path()
    if not (filename.endswith('.jpg') or filename.endswith('.png')):
        return 'Invalid file type'
    return send_from_directory(avatar_folder, filename)